package hospital;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;

import com.example.test.R;

public class hospital_product extends Activity {
	 static final String[] eagleFive = {"상품1", "상품2", "상품3", "상품4" , "상품5"} ; 
	 private ArrayAdapter<String> arrayAdapter ; 
	 private ListView listView ;
	  public void onCreate(Bundle savedInstanceState) {
	         super.onCreate(savedInstanceState);
	         setContentView(R.layout.hospital_product);
	         Log.d("msg","OnCreat1");
	         items.event_list.removeAll(items.event_list);
	         
	         Toast.makeText(hospital_product.this,"상품소개입니다.",Toast.LENGTH_SHORT).show();
	         //ImageView map = (ImageView) findViewById(R.id.map_img_test);
	         arrayAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, eagleFive);               
	         listView = (ListView)findViewById(android.R.id.list);        
	         listView.setAdapter(arrayAdapter);       
	         listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
	         ///리스트뷰 추가한부분 
	  }
	 
	 public boolean onKeyDown( int KeyCode, KeyEvent event ){
 		if( event.getAction() == KeyEvent.ACTION_DOWN ){
 			if( KeyCode == KeyEvent.KEYCODE_BACK ){
 				Intent intent = new Intent(hospital_product.this, hospital_main.class);
 				startActivityForResult(intent, 0);
 				finish();
 				
 				return false;
 			}
 		}
 		return super.onKeyDown(KeyCode, event);
 	}
}
